//导入axios
import axios from 'axios'
// 配置请求的基准URL地址
axios.defaults.baseURL = 'http://1.92.82.82:3001/'
// axios设置请求拦截器,设置响应头token
axios.interceptors.request.use(
  config => {
    // config.headers.token = window.sessionStorage.getItem('token') //每次发送请求之前自动将在session中的token提取出来当做响应头header
    config.headers.token ="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0aW1lU3RhbXAiOjE3Mjk2ODE4ODc3MzAsInBhc3N3b3JkIjoiZGM0ODNlODBhN2EwYmQ5ZWY3MWQ4Y2Y5NzM2NzM5MjQiLCJwaG9uZSI6IjE3NjEwNDE0OTU1IiwidXNlclJvbGUiOiIxIiwidXNlcklkIjoiemhhbmdzYW4ifQ.zsES_804f2OUzmWEweS-awPphRpVt6M0u8WmWP6N284";
    return config
  },
  err => {
    console.log(err)
  }
)


// 导出axios
export default axios;
